package cn.wbnyua.msm.web.dao;

import cn.wbnyua.msm.web.domain.Goods;
import cn.wbnyua.msm.web.domain.Supplier;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 作者：wbnyua.
 * 创建时间: 2023/2/8 22:56.
 */

@Mapper
public interface SupplierMapper {
    @Select("select * from supplier")
    List<Supplier> findAll();
    @Select("select * from supplier where id = #{id}")
    Supplier findById(Long id);

    @Insert("INSERT INTO `msm`.`supplier` (`name`, `contact`, `mobile`, `remark`)" +
            " VALUES (#{name}, #{contact}, #{mobile}, #{remark})")
    int add(Supplier supplier);

    @Update("UPDATE `msm`.`supplier` SET `name` = '#{name}'," +
            " `contact` = '#{contact}', `mobile` = '#{mobile}'," +
            " `remark` = '#{remark}' WHERE `id` = #{id}")
    int update(Supplier supplier);

    @Delete("delete from staff where id = #{id}")
    int remove(Long id);
}
